package com.wzn.mq.component;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.rabbitmq.http.client.domain.UserInfo;
import com.wzn.mq.domain.ProtocBaseRequest.BaseRequest;

@Component
public class UserSender {
	@Autowired
	private AmqpTemplate rabbitTemplate;

	public void send() {
		BaseRequest.Builder builder = BaseRequest.newBuilder();
		// System.out.println(this.getClass() + ">>>" + userInfo);
		builder.putSpareParameter("a", "b");
		this.rabbitTemplate.convertAndSend("user", builder.build().toByteArray());
	}
}
